首页> 外文OA文献 >Relational symbolic execution of SQL code for unit testing of database programs
【2h】

Relational symbolic execution of SQL code for unit testing of database programs

机译:用于数据库程序单元测试的sQL代码的关系符号执行

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

Symbolic execution is a technique enabling the automatic generation of test inputs that exercise a set of execution paths within a code unit to be tested. If the paths cover a sufficient part of the code under test, the test data offer a representative view of the actual behaviour of this code. This notably enables detecting errors and correcting faults. Relational databases are ubiquitous in software, but symbolic execution of code units that manipulate them remains a non-trivial problem, particularly because of the complex structure of such databases and the complex behaviour of SQL statements. Finding errors in such code units is yet critical, as it can avoid corrupting important data. In this work, we define a symbolic execution translating database manipulation code directly into constraints and integrate it with a more traditional symbolic execution of normal program code. The database tables are represented by relational symbols and the SQL statements by relational constraints over these symbols. An algorithm based on these principles is presented for the symbolic execution of simple Java methods that implement transactional use cases by reading and writing in a relational database, the latter subject to data integrity constraints. The algorithm is integrated in a test generation tool and experimented over sample code. The target language for the constraints produced by the tool is the SMT-Lib standard and the used solver is Microsoft Z3. The results show that the proposed approach enables generating meaningful test data, including valid database content, in reasonable time. In particular, the Z3 solver is shown to be more scalable than the Alloy solver, used in our previous work, for solving relational constraints.
机译:符号执行是一种能够自动生成测试输入的技术,该测试输入在要测试的代码单元内行使一组执行路径。如果路径覆盖了要测试的代码的足够部分,则测试数据可以提供该代码实际行为的代表性视图。特别是,这使得能够检测错误并纠正故障。关系数据库在软件中无处不在,但是操纵它们的代码单元的符号执行仍然是一个不小的问题,特别是由于此类数据库的复杂结构和SQL语句的复杂行为。在这样的代码单元中查找错误仍然很关键,因为它可以避免损坏重要数据。在这项工作中,我们定义了将数据库操作代码直接转换为约束的符号执行,并将其与常规程序代码的更传统的符号执行集成在一起。数据库表由关系符号表示,SQL语句由对这些符号的关系约束表示。提出了一种基于这些原理的算法,用于通过执行在关系数据库中的读写操作来实现事务用例的简单Java方法的符号执行,后者受数据完整性约束。该算法集成在测试生成工具中,并在示例代码上进行了实验。该工具产生的约束的目标语言是SMT-Lib标准,而使用的求解器是Microsoft Z3。结果表明,该方法能够在合理的时间内生成有意义的测试数据,包括有效的数据库内容。特别是,Z3解算器显示出比我们以前的工作中用于解决关系约束的合金解算器更具扩展性。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
代理获取

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号